//
// Created by Administrator on 2022/1/9 0009.
//
#include <iostream>
#include "t_force_func_template_instantion.h"
//强制编译器模板函数
void test_force_func_template_instantion(){
    using namespace std;

    int a = 10,b = 20;
    double x = 30.0,y = 40.0;

    cout<<lesser(a,b)<<endl;//use normal func ,一般函数
    cout<<lesser(x,y)<<endl;//use template func,模板函数

    cout<<lesser<>(a,b)<<endl;//use template func,模板函数[隐式实例化]
    cout<<lesser<double>(x,y)<<endl;//use template func,模板函数[显示实例化]
}

int lesser(int a,int b){
    using namespace std;
    cout<<"normal func"<<endl;
    return a < b ? a : b;
}